<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<script type="text/javascript">
    $("#itemTableList").treeTable({expandLevel: 2});
</script>
<div class="panel-body">
            <table id="itemTableList" class="table table-bordered mg-t datatable">
                <thead>
                <tr>
                    <th>序号</th>
                    <th>类别</th>
                    <th style="display:none"></th>
                    <th>处方内容</th>
                    <th>频次</th>
                    <th>途径</th>
                    <th>单次剂量</th>
                    <th>单位</th>
                    <th>包装规格</th>
                    <th>数量</th>
                    <th>库存</th>
                    <th>单价</th>
                    <th>医生说明</th>
                    <th style="display:none">隐藏值</th>
                </tr>
                </thead>
                <tbody>
                <c:forEach items="${treeList}" var="treatProjectItem" varStatus="count">
                    <c:choose>
                        <c:when test="${!empty treatProjectItem.parent.id}">
                                <tr id='${treatProjectItem.id}' pId='${treatProjectItem.parent.id}'>
                        </c:when>
                            <c:otherwise>
                                 <tr id='${treatProjectItem.id}'>
                            </c:otherwise>
                        </c:choose>
                    <td>${count.index+1}</td>
                    <td><input type="hidden" value="${treatProjectItem.orderClass}"> ${fns:getDictLabels(treatProjectItem.orderClass,'BILL_ITEM_CLASS_DICT','')}</td>
                    <td style="display:none"><input type="hidden" value="${treatProjectItem.id}"/></td>
                    <td><input type="hidden" name="list[${count.index}].drugName" value="${treatProjectItem.orderText}">${treatProjectItem.orderText}</td>
                    <td><input type="hidden" name="list[${count.index}].performFreq"
                               value="${treatProjectItem.performFreq}"> ${fns:findFreqDesc(treatProjectItem.performFreq, '')}
                    </td>
                    <td><input type="hidden" name="list[${count.index}].channel"
                               value="${treatProjectItem.administration}"> ${fns:getSysDictLabel(treatProjectItem.administration, 'ADMINISTRATION_DICT', '')}
                    </td>
                    <td><input type="number" name="list[${count.index}].singleDosage" style="width: 55px;" value="${treatProjectItem.singleDose}"></td>
                    <td><input type="hidden" name="list[${count.index}].singleUnit" value="${treatProjectItem.singleDoseUnit}">${fns:getDictLabels(treatProjectItem.singleDoseUnit,'dose_unit','')}</td>
                    <td>${treatProjectItem.packageSpec}</td>
                    <td><input type="number" name="amount" style="width: 60px;" value="${treatProjectItem.amount}"> </td>
                    <td bgcolor="#DBEFFE">${treatProjectItem.quantity}</td>
                    <td><input type="hidden" name="list[${count.index}].price" value="<fmt:formatNumber value="${treatProjectItem.price}" pattern="#.####" minFractionDigits="2" />"><fmt:formatNumber value="${treatProjectItem.price}" pattern="#.####" minFractionDigits="2" /> </td>
                    <td>${treatProjectItem.doctInstruction}</td>
                    <td style="display:none">
                        <input type="hidden" id="drugCode" value="${treatProjectItem.orderCode}">
                        <input type="hidden" id="firmId" value="${treatProjectItem.firmId}">
                        <input type="hidden" id="firmName" value="${treatProjectItem.firmName}">
                        <input type="hidden" id="newDept" value="${treatProjectItem.newDept}">
                        <input type="hidden" id="isSkin" value="${treatProjectItem.isSkin}">
                        <input type="hidden" id="packageSpec" value="${treatProjectItem.packageSpec}">
                        <input type="hidden" id="applyId" value="${treatProjectItem.applyId}">
                        <input type="hidden" id="priceId" value="${treatProjectItem.priceId}">
                        <input type="hidden" id="parent.id" value="${treatProjectItem.parent.id}">
                        <input type="hidden" id="packageUnit" value="${treatProjectItem.drugUnits}">
                        <input type="hidden" id="spec" value="${treatProjectItem.spec}">
                        <input type="hidden" value="${treatProjectItem.id}">
                    </td>
                </tr>
                </c:forEach>
            </table>
    </div>